<%@ Page Language="C#" MasterPageFile="~/cms.master" AutoEventWireup="true" CodeFile="Properties.aspx.cs"
    Inherits="Properties" Title="<%$Resources:Language,CmsPropertiesTitle %>" %>

<%@ Register Src="../controls/ctrlShowInfo.ascx" TagName="ctrlShowInfo" TagPrefix="uc1" %>
<%@ Register Src="~/controls/ctrlWait.ascx" TagName="ctrlWait" TagPrefix="ctrl" %>
<%@ Register Src="~/controls/ctrlCategoryTreeView.ascx" TagName="CategoryTreeView"
    TagPrefix="ctrl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">

    <script type="text/javascript" src="../Javascript/Properties.js"></script>

    <script language="javascript" type="text/javascript" src="../Javascript/Common.js"></script>

    <h2>
        <%=Resources.Language.CategoryProperties %>
    </h2>
    <ctrl:ctrlWait ID="ctrlWait" runat="server" />
    <asp:UpdatePanel ID="upProperties" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div id="SearchCriteriaEdit">
                <uc1:ctrlShowInfo ID="CtrlShowInfo" runat="server" />
                <div class="InlineBox">
                    <div>
                        <span class="peBoxLeft"></span><span class="peBoxRight">
                            <asp:Button ID="btnAddTop" OnClick="btnAdd_Click" runat="server" Text="<%$Resources:Language,CreateNewF %>"
                                CausesValidation="false"></asp:Button>
                            <asp:Button ID="btnChangeTop" OnClick="btnChange_Click" runat="server" Text="<%$Resources:Language,SaveChanges %>">
                            </asp:Button>
                            <asp:Button ID="btnRemoveTop" OnClick="btnRemove_Click" runat="server" Text="<%$Resources:Language,DeleteUpper %>"
                                CausesValidation="false"></asp:Button>
                        </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%=Resources.Language.Category %>: </span><span class="peBoxRight">
                                <asp:DropDownList ID="ddlCategory" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                    DataValueField="Id" DataTextField="Name" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged"
                                    CssClass="DropDownWide">
                                </asp:DropDownList>
                            </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%=Resources.Language.ProductProperty %>: </span><span class="peBoxRight">
                                <asp:DropDownList ID="ddlProperty" runat="server" OnSelectedIndexChanged="ddlProperty_SelectedIndexChanged"
                                    AppendDataBoundItems="True" AutoPostBack="True" DataValueField="Id" DataTextField="Name"
                                    CssClass="DropDown">
                                </asp:DropDownList>
                            </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%= Resources.Language.Lang %>: </span><span class="peBoxRight">
                                <asp:DropDownList ID="ddlLanguage" runat="server" DataTextField="Name" DataValueField="LanguageID"
                                    AutoPostBack="True" OnSelectedIndexChanged="ddlLanguage_SelectedIndexChanged"
                                    CssClass="DropDownShort">
                                </asp:DropDownList>
                            </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%=Resources.Language.Name %>: </span><span class="peBoxRight">
                                <asp:TextBox ID="tbName" runat="server" CssClass="TextInputWide"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="*" ControlToValidate="tbName"></asp:RequiredFieldValidator>
                            </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%=Resources.Language.Description %>: </span><span class="peBoxRight">
                                <asp:TextBox ID="tbDescription" runat="server" CssClass="TextInputMultiline" TextMode="MultiLine"></asp:TextBox>
                            </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%=Resources.Language.SearchCriterion %>: </span><span class="peBoxRight">
                                <asp:CheckBox ID="chbSearchCriterion" runat="server" Checked="true" />
                            </span>
                    </div>
                    <div class="vSeparate">
                        <span class="peBoxLeft">
                            <%=Resources.Language.PropertyType %>: </span><span class="peBoxRight">
                                <asp:DropDownList ID="ddlPropertyType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDictionaryType_SelectedValueChanged"
                                    CssClass="DropDownShort">
                                    <asp:ListItem Value="1" Text="<%$Resources:Language,Text %>">
                                    </asp:ListItem>
                                    <asp:ListItem Value="2" Text="<%$Resources:Language,DictionaryType %>">
                                    </asp:ListItem>
                                    <asp:ListItem Value="3" Text="<%$Resources:Language,Numeric %>">
                                    </asp:ListItem>
                                    <asp:ListItem Value="4" Text="<%$Resources:Language,MultiDictionaryType %>"></asp:ListItem>
                                </asp:DropDownList>
                            </span>
                    </div>
                    <asp:UpdatePanel ID="upPossibleValues" runat="server" Visible="false">
                        <ContentTemplate>
                            <div class="vSeparate">
                                <span class="peBoxLeft">
                                    <%=Resources.Language.PossibleValues %>: </span><span class="peBoxRight">
                                        <asp:GridView ID="dgvDictionary" runat="server" DataKeyNames="Value" OnRowDeleting="dgvDictionary_RowDeleting"
                                            AutoGenerateColumns="False" ShowHeader="False" OnRowEditing="dgvDictionary_RowEditing"
                                            CssClass="cmsTables">
                                            <Columns>
                                                <asp:BoundField DataField="Name" HeaderText="<%$Resources:Language,Name %>" ItemStyle-Width="200px">
                                                </asp:BoundField>
                                                <asp:CommandField EditText="<%$Resources:Language,Edit %>" ShowEditButton="True"
                                                    ItemStyle-Width="50px"></asp:CommandField>
                                                <asp:CommandField DeleteText="<%$Resources:Language,DeleteUpper %>" ShowDeleteButton="True"
                                                    ItemStyle-Width="50px"></asp:CommandField>
                                            </Columns>
                                        </asp:GridView>
                                    </span>
                            </div>
                            <div class="vSeparate">
                                <span class="peBoxLeft"></span><span class="peBoxRight">
                                    <asp:Button ID="btnAddNewValue" OnClick="btnAddNewValue_Click" runat="server" Text="<%$Resources:Language,Add %>">
                                    </asp:Button>
                                    <asp:Button ID="btnEditValue" runat="server" Text="<%$Resources:Language,Change %>"
                                        Visible="false" EnableViewState="false" OnClick="btnEditValue_Click"></asp:Button>
                                    <asp:Button ID="btnCancelEditValue" runat="server" Text="<%$Resources:Language,Leave %>"
                                        Visible="false" EnableViewState="false" OnClick="btnCancelEditValue_Click"></asp:Button>
                                    <asp:TextBox ID="txtNewValue" runat="server" MaxLength="50"></asp:TextBox>
                                </span>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div class="vSeparate">
                        <span class="peBoxLeft"></span><span class="peBoxRight">
                            <asp:Button ID="btnAddBottom" OnClick="btnAdd_Click" runat="server" CausesValidation="false"
                                OnClientClick="ScrollTop();" Text="<%$Resources:Language,CreateNewF %>"></asp:Button>
                            <asp:Button ID="btnChangeBottom" OnClick="btnChange_Click" runat="server" OnClientClick="ScrollTop();"
                                Text="<%$Resources:Language,SaveChanges %>"></asp:Button>
                            <asp:Button ID="btnRemoveBottom" OnClick="btnRemove_Click" runat="server" CausesValidation="false"
                                OnClientClick="ScrollTop();" Text="<%$Resources:Language,DeleteUpper %>"></asp:Button>
                        </span>
                    </div>
                </div>
                <div class="InlineBox">
                    <%=Resources.Language.BelongsTo %>:
                    <br />
                    <ctrl:CategoryTreeView ID="tvCategories" runat="server" ShowCheckBoxes="All" NodeSelectAction="None"
                        RootSelectAction="None" />
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
